package com.teamcenter.rac.massupdate.providers;

import org.apache.log4j.Logger;
import org.eclipse.swt.graphics.Image;

import com.teamcenter.rac.common.TCTypeRenderer;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.massupdate.model.MarkupChangeModel;
import com.teamcenter.rac.massupdate.model.UpdateJobModel;
import com.teamcenter.rac.providers.delegates.DefaultLabelProviderDelegate;

public class MarkupChangeLabelProviderDelegate extends DefaultLabelProviderDelegate {
	public String getText(Object paramObject) {
		TCComponent localTCComponent = getTCComponent(paramObject);
		String str = getProperty();
		if ((localTCComponent != null) && (str != null) && (localTCComponent.getType().equals("Fnd0MarkupChange"))) {
			int i;
			if (str.equals("fnd0status")) {
				i = Integer.parseInt(super.getText(paramObject));
				return MarkupChangeModel.MarkupChangeStatus.fromIntToString(i);
			}
			if (str.equals("fnd0markup_type")) {
				i = Integer.parseInt(super.getText(paramObject));
				return UpdateJobModel.OperationType.convertIntToDisplayString(i);
			}
		}
		return super.getText(paramObject);
	}

	public Image getImage(Object paramObject) {
		TCComponent localTCComponent1 = getTCComponent(paramObject);
		String str = getProperty();
		if ((localTCComponent1 != null) && (str != null) && (localTCComponent1.getType().equals("Fnd0MarkupChange"))
				&& ((str.equals("fnd0modified_object")) || (str.equals("fnd0input_object"))
						|| (str.equals("fnd0context")))) {
			try {
				TCComponent localTCComponent2 = localTCComponent1.getReferenceProperty(str);
				if (localTCComponent2 != null) {
					return TCTypeRenderer.getTypeImage(localTCComponent2.getType(), null);
				}
			} catch (TCException localTCException) {
				Logger.getLogger(MarkupChangeLabelProviderDelegate.class).error(localTCException.getLocalizedMessage(),
						localTCException);
			}
		}
		return null;
	}
}

/*
 * Location: D:\下载\Fw_
 * 金卡反编译需求\com.teamcenter.rac.massupdate_11000.2.0.jar!\com\teamcenter\rac\
 * massupdate\providers\MarkupChangeLabelProviderDelegate.class Java compiler
 * version: 7 (51.0) JD-Core Version: 0.7.1
 */